package com.janwen.spring.jdbc;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;


@Service("jdbcNoTrxService")
public class UserJdbcWithoutTransManager {
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	public void updateAge(String username,int age){
		String sql = "UPDATE stuff st SET st.age=? WHERE st.name=?";
		jdbcTemplate.update(sql, age,username);
	}
	
	static final Log logger = LogFactory.getLog(UserJdbcWithoutTransManager.class);
}
